#Install package
install.packages("ggforce")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/domin/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘tweenr’, ‘polyclip’, ‘systemfonts’, ‘RcppEigen’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/tweenr_2.0.2.zip'
Content type 'application/zip' length 527120 bytes (514 KB)
downloaded 514 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/polyclip_1.10-4.zip'
Content type 'application/zip' length 390320 bytes (381 KB)
downloaded 381 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/systemfonts_1.0.4.zip'
Content type 'application/zip' length 1042791 bytes (1018 KB)
downloaded 1018 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/RcppEigen_0.3.3.9.3.zip'
Content type 'application/zip' length 2276995 bytes (2.2 MB)
downloaded 2.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/ggforce_0.4.1.zip'
Content type 'application/zip' length 2160332 bytes (2.1 MB)
downloaded 2.1 MB
package ‘tweenr’ successfully unpacked and MD5 sums checked
package ‘polyclip’ successfully unpacked and MD5 sums checked
package ‘systemfonts’ successfully unpacked and MD5 sums checked
package ‘RcppEigen’ successfully unpacked and MD5 sums checked
package ‘ggforce’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\domin\AppData\Local\Temp\RtmpQP42XL\downloaded_packages
#Loading Libraries
library(viridis)
Loading required package: viridisLite
Attaching package: ‘viridis’
The following object is masked from ‘package:maps’:
unemp
#tidyverse error
install.packages("rlang")
Error in install.packages : Updating loaded packages
#Importing tick Pathogen data
Tick_Pathogens <- loadByProduct(dpID ="DP1.10092.001", site = c("SCBI", "UKFS"), package = c("basic"))
#extracting THE tick data
tick_pathogen <- Tick_Pathogens$tck_pathogen
#extracting additonal tick data test
random_test <- Tick_Pathogens$categoricalCodes_10092
detailed_tick <- random_test
categorical_codes <- detailed_tick
issues_log <- Tick_Pathogens$issueLog_10092
read_me <- Tick_Pathogens$readme_10092
validation1 <- Tick_Pathogens$validation_10092
variable1 <- Tick_Pathogens$variables_10092
#converting date to decimal
decimal_date(tick_pathogen$collectDate)
[1] 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438
[11] 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438
[21] 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438
[31] 2014.438 2014.438 2014.438 2014.438 2014.438 2014.438 2014.440 2014.440 2014.440 2014.440
[41] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[51] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[61] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[71] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[81] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[91] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[101] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[111] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[121] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[131] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[141] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[151] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[161] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[171] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[181] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[191] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[201] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[211] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[221] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[231] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[241] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[251] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[261] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[271] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[281] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[291] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[301] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[311] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[321] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[331] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[341] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[351] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[361] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[371] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[381] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[391] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[401] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[411] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[421] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[431] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[441] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[451] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[461] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[471] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[481] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[491] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[501] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[511] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[521] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[531] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[541] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[551] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[561] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[571] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[581] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[591] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[601] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[611] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[621] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[631] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[641] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[651] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[661] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[671] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[681] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[691] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[701] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[711] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[721] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[731] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[741] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[751] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[761] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[771] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[781] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[791] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[801] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[811] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[821] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[831] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[841] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[851] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[861] 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440 2014.440
[871] 2014.440 2014.440 2014.440 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[881] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[891] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[901] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[911] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[921] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[931] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[941] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[951] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[961] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[971] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[981] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[991] 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441 2014.441
[ reached getOption("max.print") -- omitted 34007 entries ]
#New column for decimal date
tick_pathogen <-
tick_pathogen%>%
mutate(decimaldate = decimal_date(tick_pathogen$collectDate))
tick_pathogen <-
tick_pathogen%>%
mutate(decimaldate = decimal_date(tick_pathogen$collectDate))
#removing NA data
tick_pathogen <- filter(tick_pathogen, !is.na(tick_pathogen$testResult))
#remove unwanted data
tick_pathogen <-tick_pathogen %>%
select(siteID, plotID, plotType, nlcdClass, decimalLatitude, decimalLongitude, elevation, collectDate, testedDate, individualCount, testResult, testPathogenName)
#saving the data
save(tick_pathogen, file = "data/tick_pathogen.Rdata")
load("data/tick_pathogen.Rdata")
#graphing some data
ggplot(tick_pathogen)+
geom_line(mapping = aes(x = elevation, y = testResult, color = siteID))
ggplot(tick_pathogen)+
geom_point(mapping = aes(x = collectDate, y = testResult, color = siteID))
ggplot(tick_pathogen)+
geom_col(mapping = aes(x = testPathogenName, y = testResult, fill = siteID), position = "dodge")+
facet_wrap(~testPathogenName)+
theme(axis.text.x = element_blank())
NA
#for tilting the x axis labels
theme(axis.text.x = element_text(angle = 45))
#attempt 1 filter data only SCBI #filtering data
filter(tick_pathogen, testResult == "Positive", siteID == "SCBI")
#convert postitve and negtive to 0 and 1
tick_pathogen <-
tick_pathogen%>%
mutate(testResultnum = ifelse(tick_pathogen$testResult == "Positive",1,0))
#filter sites seperate
site1 <- filter(tick_pathogen, siteID == "SCBI")
site2 <- filter(tick_pathogen, siteID == "UKFS")
#new data sets for invidual diseases
borrelia <- filter(site1, testPathogenName == "Borrelia sp.")
borrelia2 <- filter(site2, testPathogenName == "Borrelia sp.")
#save the seperate site data
save(site1, file = "data/site1.Rdata")
load("data/tick_pathogen.Rdata")
#graph tests #graphs using filters
ggplot(data = site1)+
geom_jitter(mapping = aes(decimaldate,testResultnum,color = testResult))+
facet_wrap(~testPathogenName)+
theme(axis.text.x = element_blank())+
theme(strip.text = element_text(size = 6, face = "bold"))
NA
ggplot(data = site2)+
geom_jitter(mapping = aes(decimaldate,testResultnum,color = testResult))+
facet_wrap(~testPathogenName)+
theme(axis.text.x = element_blank())+
theme(strip.text = element_text(size = 8, face = "bold"))
#graph with single disease site 1
ggplot(borrelia)+
geom_jitter(mapping = aes(x = decimaldate, y = testResultnum, color = testResult))+
facet_wrap(~testResult)
#graph with single disease site 2
ggplot(borrelia2)+
geom_jitter(mapping = aes(x = decimaldate, y = testResultnum, color = testResult))+
facet_wrap(~testResult)
##WIPS #atempt with zooming one year(doesnt work)
filter(data = borrelia (x = date "2017-03-22", date <= "2017-09-15")+
ggplot(borrelia)+
geom_point(mapping = aes(x = decimaldate, y = testResultnum, color = testResult))+
facet_wrap(~testResult)
#graph seperate by site working on by year (doesnt work)
ggplot(site1)+
geom_point(mapping = aes(x = decimaldate, y = testPathogenName))+
geom_line()+
scale_x_date(date_minor_breaks = "1 year")
#graph time series for disease over time want in blocks #color by disease (on y)on axis no test result only data,blocked off (works kinda)
ggplot(tick_pathogen)+
geom_point(mapping = aes(x = testResultnum, y = decimaldate, color = testPathogenName))+
facet_wrap(~testResultnum)
NA
#seperate year borrelia1 only
ggplot(data = borrelia1, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2014, 2016))
ggplot(data = borrelia1, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2016, 2017))
ggplot(data = borrelia1, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2017, 2018))
ggplot(data = borrelia1, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2018, 2019))
ggplot(data = borrelia1, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2019, 2020))
ggplot(data = borrelia1, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2020, 2021))
ggplot(data = borrelia1, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2021, 2022))
#seperate year borrelia2 only
ggplot(data = borrelia2, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2015, 2016))
ggplot(data = borrelia2, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2016, 2017))
ggplot(data = borrelia2, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2017, 2018))
ggplot(data = borrelia2, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2018, 2019))
ggplot(data = borrelia2, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2019, 2020))
ggplot(data = borrelia2, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2020, 2021))
ggplot(data = borrelia2, aes(x = decimaldate, y = testResultnum, color = testResultnum))+
geom_jitter()+
facet_zoom(xlim = c(2021, 2022))
#zoom with all the diseases from site1
ggplot(data = site1, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "C")+
facet_zoom(xlim = c(2014, 2016))
ggplot(data = site1, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "C")+
facet_zoom(xlim = c(2016, 2018))
ggplot(data = site1, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "C")+
facet_zoom(xlim = c(2018, 2019))
ggplot(data = site1, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "C")+
facet_zoom(xlim = c(2019, 2021))
ggplot(data = site1, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "C")+
facet_zoom(xlim = c(2021, 2022))
#zoom all disease from site2
ggplot(data = site2, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "C")+
facet_zoom(xlim = c(2015, 2016))
ggplot(data = site2, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "H")+
facet_zoom(xlim = c(2016, 2017))
ggplot(data = site2, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "H")+
facet_zoom(xlim = c(2017, 2018))
ggplot(data = site2, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "H")+
facet_zoom(xlim = c(2018, 2019))
ggplot(data = site2, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "H")+
facet_zoom(xlim = c(2019, 2020))
ggplot(data = site2, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "H")+
facet_zoom(xlim = c(2020, 2021))
ggplot(data = site2, aes(x = decimaldate, y = testResultnum, color = testPathogenName))+
geom_jitter()+
scale_color_viridis(discrete = TRUE, option = "H")+
facet_zoom(xlim = c(2021, 2022))
#maps #need the google key
register_google(key = "AIzaSyAFj9wnW3354ZdqUCJyM8pn8AQWg7MJc3Y")
#map of site2 location kanas
ks <- c(lon = -95.19215, lat = 39.040431)
ks_map <- get_map(location = ks, zoom = 15)
ℹ <]8;;https://maps.googleapis.com/maps/api/staticmap?center=39.040431,-95.19215&zoom=15&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxxhttps://maps.googleapis.com/maps/api/staticmap?center=39.040431,-95.19215&zoom=15&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx]8;;>
ggmap(ks_map)
#map again zoomed out site2
ks <- c(lon = -95.19215, lat = 39.040431)
ks_map3 <- get_map(location = ks, zoom = 6)
ℹ <]8;;https://maps.googleapis.com/maps/api/staticmap?center=39.040431,-95.19215&zoom=6&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxxhttps://maps.googleapis.com/maps/api/staticmap?center=39.040431,-95.19215&zoom=6&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx]8;;>
ggmap(ks_map3)
#map with locaiton point kanas
ks_map2 <- get_map(location = `ks`, source = "stamen",zoom = 9, maptype = "terrain")
ℹ <]8;;https://maps.googleapis.com/maps/api/staticmap?center=39.040431,-95.19215&zoom=9&size=640x640&scale=2&maptype=terrain&key=xxxhttps://maps.googleapis.com/maps/api/staticmap?center=39.040431,-95.19215&zoom=9&size=640x640&scale=2&maptype=terrain&key=xxx]8;;>
ℹ Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.
ggmap(ks_map2)
ggmap(ks_map2) +
geom_point(data = ks, mapping = aes(x = lat, y = lon), size = 10)
Error in `fortify()`:
! `data` must be a <data.frame>, or an object coercible by `fortify()`, not a numeric vector.
Backtrace:
1. ggplot2::geom_point(...)
2. ggplot2::layer(...)
4. ggplot2:::fortify.default(data)
#maps of site1 virginia
va <- c(lon = -78.1454, lat = 38.8935)
va_map <- get_map(location = va, zoom = 10)
ℹ <]8;;https://maps.googleapis.com/maps/api/staticmap?center=38.8935,-78.1454&zoom=10&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxxhttps://maps.googleapis.com/maps/api/staticmap?center=38.8935,-78.1454&zoom=10&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx]8;;>
ggmap(va_map)
#map with location data point (virginia)